import { request } from "../../utils/request";

//获取说有的轮播图
export function ApiGetBanners()
{
	return request({
		method: "GET",
		url:"carouselSlides/getCarouselSlides"
	})
}

//获取热门标签
export function ApigetCategroyTags()
{
	return request({
		method: "GET",
		url:"category/getAllCategoryTags"
	})
}

//获取热门标签里面的数据
export function ApiGetCategroyNovels()
{
	return request({
		method: "GET",
		url:"novel/getHotNovels"
	})
}

//感觉类型名称获取热点数据
export function ApigetHotCateGroyByType(name)
{
	return request({
		method: "GET",
		url:`novel/getHotNovelsByType?name=${name}`
	})
}

//获取排行榜数据
export function ApigetRankNovels()
{
	return request({
		method: "GET",
		url:"novel/getRankNovels"
	})
}

//获取限时免费小说
export function ApiGetFreeNovels()
{
	return request({
		method: "GET",
		url:"novel/getFreeNovels"
	})
}

//获取猜你喜欢的数据
export function ApiGetLike(pageNum,size)
{
	return request({
		method: "GET",
		url:`novel/getUserLikeNovels?pageNum=${pageNum}&size=${size}`
	})
}

//获取最新的小说
export function ApiGetNewNovel()
{
	return request({
		method: "GET",
		url:"novel/getNewestNovels"
	})
}

//获取分类数据
export function ApigetCategroys(type)
{
	return request({
		method: "GET",
		url:`category/getCategoryNovels?type=${type}`
	})
}

//分页获取排行榜数据
export function ApigetRankPage(tag,pageNum,size)
{
	return request({
		method: "GET",
		url:`novel/getRankNovelsByPage?tag=${tag}&pageNum=${pageNum}&size=${size}`
	})
}

//根据类型分页获取数据
export function ApiGetNovelByTypePage(type,pageNum,size,sort)
{
	return request({
		method: "GET",
		url:`novel/getNovelsByType?type=${type}&pageNum=${pageNum}&size=${size}&sort=${sort}`
	})
}

//获取新书综合评分最高的5个小说
export function APiGetNewNovelrank()
{
	return request({
		method: "GET",
		url:"novel/getNewRankNovels"
	})
}

//获取潜力小说
export function APigetPotentialNewBook()
{
	return request({
		method: "GET",
		url:"novel/getPotentialNewBook"
	})
}

//获取新书首发
export function APigetNewBookReleases()
{
	return request({
		method: "GET",
		url:"novel/getNewBookReleases"
	})
}

//分页获取书架的数据
export function APigetBookSelf(pageNum,size)
{
	return request({
		method: "GET",
		url:`novelSelf/getNovelSelf?pageNum=${pageNum}&size=${size}`
	})
}

//获取最新的阅读记录
export function ApigetnewRecord()
{
	return request({
		method: "GET",
		url:"history/getNewestHistory"
	})
}

//分页获取浏览历史
export function ApigetHistoryPage(pageNum,size)
{
	return request({
		method: "GET",
		url:`history/getHistoryByPage?pageNum=${pageNum}&size=${size}`
	})
}

//清除浏览历史
export function ApiClearHistory()
{
	return request({
		method: "GET",
		url:"history/clearHistory"
	})
}

//根据id清除浏览历史
export function ApiClearHistoryById(historyId)
{
	return request({
		method: "GET",
		url:`history/clearHistoryById?historyId=${historyId}`
	})
}

//保存浏览历史
export function ApiSaveHistory(novelId,chapterIndex,page)
{
	return request({
		method: "GET",
		url:`history/saveHistory?novelId=${novelId}&chapterIndex=${chapterIndex}&page=${page}`
	})
}

//根据id获取浏览历史
export function ApigetHistoryByNovelId(novelId)
{
	return request({
		method: "GET",
		url:`history/getHistoryByNovelId?novelId=${novelId}`
	})
}

//搜索书籍
export function ApiSearchNovel(keyword)
{
	return request({
		method: "GET",
		url:`novel/searchBook?keyword=${keyword}`
	})
}

//获取热搜数据
export function ApigetHotSearch(pageNum,size)
{
	return request({
		method: "GET",
		url:`novel/getHotSearch?pageNum=${pageNum}&size=${size}`
	})
}

//更新搜索次数
export function ApiAddSearchCount(novelId)
{
	return request({
		method: "GET",
		url:`novel/updateSearch?novelId=${novelId}`
	})
}

//更新阅读次数
export function ApiReadCount(novelId)
{
	return request({
		method: "GET",
		url:`novel/updateViewCount?novelId=${novelId}`
	})
}

//根据小说id获取小说数据
export function ApiGetNovel(novelId)
{
	return request({
		method: "GET",
		url:`novel/getNovelById?novelId=${novelId}`
	})
}

//添加小说
export function ApiAddNovelSelf(novelId)
{
	return request({
		method: "GET",
		url:`novelSelf/addNovelSelf?novelId=${novelId}`
	})
}

//删除小说
export function ApiDeleteNovelSelf(novelId)
{
	return request({
		method: "GET",
		url:`novelSelf/deleteNovelSelf?novelId=${novelId}`
	})
}

//获取用户的评分
export function ApiGetRatingScore(novelId)
{
	return request({
		method: "GET",
		url:`rating/getRating?novelId=${novelId}`
	})
}

//对小说进行评分
export function ApiAddRate(novelId,score)
{
	return request({
		method: "GET",
		url:`rating/setRating?novelId=${novelId}&score=${score}`
	})
}

//Ai搜书
export function ApiAiSearch(keyword)
{
	return request({
		method: "GET",
		url:`novelAgent/searchBook?keyword=${keyword}`
	})
}

//清除缓存
export function ApiClearCache()
{
	return request({
		method: "GET",
		url:"novelAgent/clearCache"
	})
}

//保存阅读时间
export function ApiSaveTime(time)
{
	return request({
		method: "GET",
		url:`/saveUserReadTime?time=${time}`
	})
}